<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui"/>
    <title>{$row.title}</title>
    <script src="__CDN__/assets/libs/mui/mui.min.js"></script>
    <script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
    <script src="__CDN__/assets/libs/fastadmin-layer/dist/layer.js"></script>
    <link href="__CDN__/assets/libs/mui//mui.min.css" rel="stylesheet"/>
    <link rel="shortcut icon" href="{$row->manystoreshop->logo|cdnurl}"/>




    <script type="text/javascript" charset="utf-8">
        mui.init();
        $(function () {
            $(".upload").on("click", function () {
                let obj = this;
                var ii = layer.load();
                // layer.msg('领取后该视频将自动转发');



                    layer.open({
                      content: '领取后该视频将自动转发',
                      yes: function(index, layero){
                          $(obj).attr('disabled', 'disabled').text('已提交');


                        mui.ajax("{:url('index/index/upload')}", {
                            data: {
                                open_id: '{$open_id}',
                                access_token: '{$access_token}',
                                aivideo: '{$video.id}',
                                ids: '{$row.id}',
                                cardid:'cardid',
                            },
                            dataType: 'json',//服务器返回json格式数据
                            type: 'post',//HTTP请求类型
                            timeout: 10000,//超时时间设置为6秒；
                            headers: {'Content-Type': 'application/json'},
                            success: function (data) {
                                layer.close(ii);
                                layer.msg(data.msg,function () {
                                    window.location.href="{$redirect_url}"
                                });
                            },
                            error: function (xhr, type, errorThrown) {
                                //异常处理；
                                if (type == "timeout") {
                                    layer.close(ii);
                                    layer.msg("领取卡劵成功",function () {
                                        window.location.href="{$redirect_url}"
                                    });
                                } else {
                                    layer.close(ii);
                                    layer.msg(data.msg,function () {
                                        window.location.href="{$redirect_url}"
                                    });
                                }
                            }
                        });





                        
                        //do something
                        layer.close(index); //如果设定了yes回调，需进行手工关闭
                      }
                    });      




            });


        })

    </script>

    <style>
        .mui-show-loading {
            position: fixed;
            padding: 5px;
            width: 120px;
            min-height: 120px;
            top: 45%;
            left: 50%;
            margin-left: -60px;
            background: rgba(0, 0, 0, 0.6);
            text-align: center;
            border-radius: 5px;
            color: #FFFFFF;
            visibility: hidden;
            margin: 0;
            z-index: 2000;

            -webkit-transition-duration: .2s;
            transition-duration: .2s;
            opacity: 0;
            -webkit-transform: scale(0.9) translate(-50%, -50%);
            transform: scale(0.9) translate(-50%, -50%);
            -webkit-transform-origin: 0 0;
            transform-origin: 0 0;
        }

        .mui-show-loading.loading-visible {
            opacity: 1;
            visibility: visible;
            -webkit-transform: scale(1) translate(-50%, -50%);
            transform: scale(1) translate(-50%, -50%);
        }

        .mui-show-loading .mui-spinner {
            margin-top: 24px;
            width: 36px;
            height: 36px;
        }

        .mui-show-loading .text {
            line-height: 1.6;
            font-family: -apple-system-font, "Helvetica Neue", sans-serif;
            font-size: 14px;
            margin: 10px 0 0;
            color: #fff;
        }

        .mui-show-loading-mask {
            position: fixed;
            z-index: 1000;
            top: 0;
            right: 0;
            left: 0;
            bottom: 0;
        }

        .mui-show-loading-mask-hidden {
            display: none !important;
        }


        body, html {
            width: 100%;
            box-sizing: border-box;
            height: 100%;
        }

        .my_body {
            width: 100%;
            display: flex;
            height: 100%;
            background-color: #000000;
            flex-direction: column;
            box-sizing: border-box;
            position: relative;
        }

        .div_nums_show_outer {
            height: 4rem;
            margin-left: 1rem;
            margin-right: 1rem;
            border-radius: 20rem;
            background: #FFFFFF;
            margin-top: -2rem;
            z-index: 9999;
        }

        .div_nums_show {
            display: flex;
            flex-direction: row;
            justify-content: space-around;
            height: 4rem;
            width: 100%;
            align-items: center;

        }

        .my_video {
            background-color: #0062CC;
            object-fit: fill;
        }

        .div_nums_show_item {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .div_nums_show_item span:nth-child(odd) {
            font-size: 1.5rem;
            color: #EC4E91;
        }

        .div_nums_show_item span:nth-child(even) {
            font-size: 1rem;
            color: #333333;
            padding-top: 0.2rem;
        }

        .div_ad {
            height: 6.5rem;
            margin-left: 1rem;
            margin-right: 1rem;
            border-radius: 1rem;
            background: #3C3A3B;
            margin-top: 1rem;
            z-index: 9999;

            flex-direction: column;
            border-bottom: 1.5rem solid #F0CF99;
        }

        .div_ad_top {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
        }

        .div_ad_top_left {
            display: flex;
            flex-direction: row;
            align-items: center;

        }

        .div_ad_top_left img {
            width: 4rem;
            height: 4rem;
            border-radius: 25rem;
            margin-top: 0.5rem;
            margin-left: 0.5rem;
        }

        .div_ad_top_left_item {
            display: flex;
            flex-direction: column;
            padding-left: 1rem;
        }

        .div_ad_top_left_item span:nth-child(odd) {
            font-size: 0.9rem;
            color: #FFFFFF;
            padding-bottom: 0.5rem;
        }

        .div_ad_top_left_item span:nth-child(even) {
            font-size: 1.2rem;
            color: #F0CF99;
        }

        .div_ad_top_right {
            padding-right: 1rem;
        }

        .div_ad_top_right button {
            color: #ffffff;
            background: #F0CF99;
            border-radius: 10rem;
            padding-left: 0.7rem;
            padding-right: 0.7rem;
            padding-top: 0.2rem;
            padding-bottom: 0.2rem;
            font-size: 0.6rem;
        }

        .div_ad_bottom {
            display: flex;
            flex-direction: row;
            margin-top: 0.7rem;
            color: #5E5D5D;
            margin-left: 0.5rem;
            font-size: 0.8rem;
        }

        li {
            color: #ffffff;
        }

        .dic_activ_show_out {
            width: 100%;
            box-sizing: border-box;
            background-color: black;
        }

        .dic_activ_show {

            padding-top: 1rem;
            padding-bottom: 2rem;
            margin-left: 1rem;
            margin-right: 1rem;
            border-radius: 1rem;
            background: #22242E;
            margin-top: 1rem;
            z-index: 9999;
            display: flex;
            flex-direction: column;

        }

        .dic_activ_show span:nth-child(odd) {
            color: #ffffff;
            width: 100%;
            align-items: center;
            text-align: center;
        }

        .dic_activ_show span:nth-child(even) {
            color: #ffffff;

            font-size: 1rem;
            text-indent: 2em;
        }

        .my_textare {

            margin-top: 0.5rem;

        }

        .div_bottom {
            z-index: 99999999;
            position: fixed;
            bottom: 0;
            height: 3rem;
            left: 0;
            width: 100%;
            margin-bottom: 1rem;
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
        }

        .div_bottom button:nth-child(odd) {
            border-top-left-radius: 1.5rem;
            border-bottom-left-radius: 1.5rem;
            background-color: #F77369;
            padding: 0;
            border: none;
            color: #ffffff;

            width: 45%;
            text-align: center;
            line-height: 3rem;
        }

        .div_bottom button:nth-child(even) {
            border-top-right-radius: 1.5rem;
            border-bottom-right-radius: 1.5rem;
            background-color: #EBC688;
            padding: 0;
            border: none;
            color: #ffffff;

            width: 45%;
            text-align: center;
            line-height: 3rem;
        }

        .my_textare img {
            max-width: 100%;
            height: auto !important;
            margin: 5px 0;
        }

        .div_upload {
            margin-left: 1rem;
            margin-right: 1rem;
            margin-top: 1rem;
        }

        .div_upload button {
            border-radius: 1.5rem;
            background-color: #F0CF99;
            padding: 0;
            border: none;
            color: #22242E;
            width: 100%;
            font-size: large;
            text-align: center;
            line-height: 3rem;
        }
        .my_video{margin:0 auto;}

    </style>
</head>
<body>
<div class="my_body">

    <!--原生播放器-->
    <!--    <video class="my_video"  height="200" autoplay="autoplay" controls="controls">
            <source src="{$video.local}" type="video/mp4">
            <input>
        </video>-->


    <!--西瓜播放器-->
    <div id="mse"></div>
    <!--西瓜播放器-->
    <script src="//cdn.jsdelivr.net/npm/xgplayer@1.1.4/browser/index.js" charset="utf-8"></script>
    <script>
        let player = new Player({
            "id": "mse",
            "url": "{$video.local}",
            "playsinline": true,
            "whitelist": [
                ""
            ],
            "autoplay": true,
            "fluid": true,
            "download": true
        });

    </script>


    <!-- <div class="div_nums_show_outer">
         <div class="div_nums_show">
             <div class="div_nums_show_item">
                 <span>27W</span>
                 <span>累计播放</span>
             </div>
             <div class="div_nums_show_item">
                 <span>27W</span>
                 <span>浏览量</span>
             </div>
             <div class="div_nums_show_item">
                 <span>27</span>
                 <span>分享次数</span>
             </div>
         </div>
     </div>-->
    {if condition="$row->paytype === '0'"}
    <div class="div_ad">
        <div class="div_ad_top">
            <div class="div_ad_top_left">
                <img src="{$row->manystoreshop->logo|cdnurl}"/>
                <div class="div_ad_top_left_item">
                    <span>代金券</span>
                    <span>{$row->card->rule}</span>
                </div>
            </div>

        </div>
        <div class="div_ad_bottom">
            <li></li>
            活动有效期到{$day}
        </div>

    </div>
    {/if}

    <div class="dic_activ_show_out">
        <div class="dic_activ_show">
            <span>活动介绍</span>

            <div class="my_textare">{$row->content}</div>
        </div>
    </div>


    <div class="div_bottom">

        <button class="mui-btn" onclick="window.location.href='{$mycard_url}'">我的卡券</button>
        <button class="upload mui-btn">发布领取福利</button>
    </div>
</div>

</body>

</html>